package com.hljx.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hljx.config.Result;
import com.hljx.dto.WorkloadAppealDTO;
import com.hljx.entity.WorkloadAppeal;
import com.hljx.service.WorkloadAppealService;
import com.hljx.vo.UserLoginVO;
import com.hljx.vo.WorkloadAppealVO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 工作量申诉 前端控制器
 * </p>
 *
 * @author ${author}
 * @since 2024-04-22
 */
@Tag(name = "工作量申诉")
@RestController
@RequestMapping("/workloadAppeal")
public class WorkloadAppealController {

    @Autowired
    private WorkloadAppealService workloadAppealService;

    @Operation(summary = "保存更新")
    @PostMapping("/saveOrUpdate")
    public Result<Boolean> saveOrUpdate(@RequestBody WorkloadAppeal workloadAppeal)
    {
       return Result.success(workloadAppealService.saveOrUpdate(workloadAppeal));
    }
    @Operation(summary = "分页查询")
    @PostMapping("/listByPage")
    public Result<IPage<WorkloadAppealVO> > listByPage(@RequestBody WorkloadAppealDTO dto)
    {
        return Result.success(workloadAppealService.listByPage(dto));
    }
    @Operation(summary = "撤销")
    @GetMapping("/removeById")
    public Result<Boolean> removeById(Long id)
    {
        return Result.success(workloadAppealService.delete(id));
    }
}
